﻿using AJWPFAdmin.Core.CommonEntity;
using AJWPFAdmin.Core.Enums;
using AJWPFAdmin.Core.HardwareSDKS.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AJWPFAdmin.Core.Models.EF.Tables
{
    /// <summary>
    /// 设备表
    /// </summary>
    [Comment("设备表")]
    public partial class Device : CommonTableEntity
    {

        /// <summary>
        /// 关联岗亭Id
        /// </summary>
        public long WatchhouseId { get; set; }


        /// <summary>
        /// 关联通道id
        /// </summary>
        public long PassagewayId { get; set; }

        /// <summary>
        /// 导航属性,关联通道数据
        /// </summary>
        [ForeignKey("PassagewayId")]
        public virtual Passageway Passageway { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        public DeviceType Type { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        [Comment("编号")]
        [MaxLength(50)]
        public string Code { get; set; }

        /// <summary>
        /// 设备IP地址
        /// </summary>
        [Comment("设备IP地址")]
        [MaxLength(50)]
        public string IP { get; set; }

        /// <summary>
        /// 设备串口号
        /// </summary>
        [Comment("设备串口号")]
        [MaxLength(10)]
        public SerialPortType SerialPort { get; set; }

        /// <summary>
        /// 设备端口号
        /// </summary>
        [Comment("设备端口号")]
        public int Port { get; set; }

        /// <summary>
        /// 登录账户名
        /// </summary>
        [Comment("登录账户名")]
        [MaxLength(50)]
        public string LoginName { get; set; }

        /// <summary>
        /// 登录密码
        /// </summary>
        [Comment("登录密码")]
        [MaxLength(100)]
        public string LoginPassword { get; set; }

        /// <summary>
        /// 仅作为监控
        /// </summary>
        [Comment("是否仅作为监控")]
        public bool OnlyMonitor { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Comment("名称")]
        [MaxLength(20)]
        public string Name { get; set; }

        /// <summary>
        /// 是否已同步
        /// </summary>
        [Comment("是否已同步")]
        [Display(Name = "是否同步")]
        public bool Synchronized { get; set; }

        /// <summary>
        /// 同步结果,备用
        /// </summary>
        [Comment("同步结果,备用")]
        public string SyncResult { get; set; }

        /// <summary>
        /// 设备SN号
        /// </summary>
        [Comment("设备SN号")]
        [MaxLength(100)]
        public string DevNo { get; set; }

        /// <summary>
        /// 监控部位类型
        /// </summary>
        [Comment("监控部位类型")]
        public WatchPositionType? WatchPosition { get; set; }

        /// <summary>
        /// 是否启用手动开闸录像
        /// </summary>
        [Comment("是否启用手动开闸录像")]
        public bool EnableVideoCapture
        {
            get; set;
        }

        /// <summary>
        /// 录像时长(秒)
        /// </summary>
        [Comment("录像时长(秒)")]
        public double? VideoDuration
        {
            get; set;
        }

        /// <summary>
        /// 自动触发录像相机IN值
        /// </summary>
        [Comment("自动触发录像相机IN值")]
        public string AutoVideoCaptureINValue { get; set; }

        /// <summary>
        /// 是否启用IO2报警, 目前仅针对臻识有效
        /// </summary>
        [Comment("是否启用IO2报警")]
        public bool EnableIO2Alarm { get; set; }

        /// <summary>
        /// IO2报警延迟秒数,目前仅针对臻识有效
        /// </summary>
        [Comment("IO2报警延迟秒数")]
        public int IO2AlarmDelaySeconds { get; set; }

        /// <summary>
        /// RTSP视频播放地址
        /// </summary>
        [Comment("RTSP视频播放地址")]
        public string VideoPlayRTSPUrl { get; set; }

        /// <summary>
        /// RTSP视频回放地址
        /// </summary>
        [Comment("RTSP视频回放地址")]
        public string VideoPlayBackRTSPUrl { get; set; }
    }
}
